WooCommerce: Get All Variations For A Given Product

When you deal with WooCommerce variable products and custom code, you may need to programmatically access all the variations based on a given (parent) product ID.

This post dives into the world of WooCommerce product variations and shows you two powerful PHP methods to retrieve all the variations associated with a specific product ID.

We’ll explore several approaches, and by the end, you’ll be equipped to effortlessly handle variations in your code, based on what exact output you need. Enjoy!

Continue reading WooCommerce: Get All Variations For A Given Product

WooCommerce: Display All Single Variations (Shortcode)

By default, the WooCommerce Shop page displays simple, variable, grouped, bundle and other product types. As you know, each variable product is made of one or more “single variations”, and these are only visible in the single product page.

Now, what if you want to display a grid of all “single variations” in a custom page / post? Well, a shortcode can be coded so that you can achieve just that. Enjoy!

Continue reading WooCommerce: Display All Single Variations (Shortcode)

WooCommerce: Why Use A Product Configurator Instead of Variations

One of the biggest marketing trends in recent years is the increasing shift towards delivering customized and personalized product experiences to customers. 

Customers are increasingly looking for online and eCommerce stores that provide order customization options for gifting purposes and the ability to add their personal and unique touch to their orders. While 90% of the U.S. customers find the idea of personalization appealing – impersonal shopping experiences frustrate 71% of customers

Thus, as a WooCommerce store owner – it’s important to strive and meet the increasing consumer demands to prevent dissatisfaction, improve their shopping experiences and increase the overall sales.  

This article will see some easy yet impactful ways to deliver a personalized customer experience and order customization. But first, let’s see how it can benefit your WooCommerce store. 

Continue reading WooCommerce: Why Use A Product Configurator Instead of Variations

WooCommerce: How to Add Custom Fields to Variations

When selling products on your WooCommerce store – you want to provide as much product information as possible to your customers. This is especially because, unlike a physical shop or a brick and mortar store – your online customers cannot physically touch or experience the products before buying them. 

Hence, providing additional information and keeping customers informed about the multiple facets of your products is essential. And an effective way to enhance customer experience is by adding custom fields for product variations. 

Product variations are product attributes – including the product’s size, color, pattern, texture, and style. On the other hand, WooCommerce custom fields allow you to add additional data for individual products – to display on a single product page. 

Custom field variations let you add data unique to an individual product – which can include anything from the product’s ISBN, additional product specifications, radio buttons, and checkboxes. Thus, custom fields for product variations could either mean: 

  • Fields to display additional product variation’s information, or 
  • Fields to accept customer input to customize the product variation through dropdowns or radio buttons. 

So, in this article, we share simple yet efficient ways to add custom fields to product variations. But, first – let’s see how adding fields for product variations help your WooCommerce store. 

Continue reading WooCommerce: How to Add Custom Fields to Variations

WooCommerce: Display Variations’ SKU @ Product Admin

I find it quite annoying that variable products display an empty SKU cell in the WordPress > Products admin page even if their variations may have one available.

Today, we go fix that. With this simple snippet, your variable products will display the SKU of each variation, and if there is none, empty brackets (so, it’s easy to identify if any variation is missing its SKU).

So, let’s see how it’s done. Enjoy!

Continue reading WooCommerce: Display Variations’ SKU @ Product Admin

WooCommerce: Disable Out of Stock Variations @ Variable Product Dropdown

A nice way to avoid user frustration is to never let them pick a product / variation that is out of stock, only to realize later they can’t purchase it.

A variable product comes with a “select dropdown” on the single product page, from which customers can pick their favorite variation. Problem is that ONLY after selecting this they will find out about price, stock status and may be able to add to cart.

Today, we’ll completely disable (grey-out) those select dropdown options (variations) that are out of stock, so that users don’t waste time and only pick one of those that are in stock. Enjoy!

Continue reading WooCommerce: Disable Out of Stock Variations @ Variable Product Dropdown

WooCommerce: Add Custom Field to Product Variations

Adding and displaying custom fields on WooCommerce products is quite simple. For example, you can add a “RRP/MSRP” field to a product, or maybe use ACF and display its value on the single product page.

Easy, yes. Unfortunately, the above only applies to “simple” products without variations (or the parent product if it’s a variable product). So the question is: how do we add, save and display a custom field for each single variation?

Continue reading WooCommerce: Add Custom Field to Product Variations

WooCommerce: How to Display Variations with Color / Size Buttons?

Displaying product pages nicely is the entrepreneur’s dream.

Good UX means a much higher probability the interested customer is going to add to cart and complete the checkout.

However, WooCommerce variable products come with annoying dropdowns for each attribute (color, size, style, etc. depending on what options you have set up). And as you’ve already got a hint of my personal opinion, dropdowns are UX-killers.

Today, we take a look at handy plugins you can use to display product options (variations) in a user-friendly way. I’ve used these on many websites and they’re pretty reliable. As usual, it’s just the click of a button!

Continue reading WooCommerce: How to Display Variations with Color / Size Buttons?

WooCommerce: How to Add to Cart Multiple Variations at Once?

This is a very common issue for B2B / Wholesale WooCommerce website managers. In these case scenarios, clients usually need to add to cart multiple variations to cart on the same page, without refreshing it each time.

For example, a clothing wholesale client wishes to order 100 Medium, 150 Large and 50 Small t-shirts without having to switch dropdown/swatch choice, click on 3 add to cart buttons and wasting time.

Thankfully, there are WooCommerce plugins for that. And today I give you a few premium choices.

No matter whether each variation is displayed in a table and has its own add to cart button or there is a single add to cart button for all variations – ordering more products at the same is a breeze!

Continue reading WooCommerce: How to Add to Cart Multiple Variations at Once?

WooCommerce: Display Variations’ Stock @ Shop Page

Thanks to the various requests I get from Business Bloomer fans, this week I’m going to show you a simple PHP snippet to echo the variations’ name and stock quantity on the shop, categories and loop pages.

Of course, if “Manage stock” is not enabled at variation level, the quantity will be null, and therefore the returned string will just say “In stock” or “Out of stock”.

Enjoy!

Continue reading WooCommerce: Display Variations’ Stock @ Shop Page

WooCommerce: How to Implement AI Translation

Reaching customers globally can increase your WooCommerce website sales.

Besides, because your WooCommerce website can now operate in several countries, this reduces dependence on a single market and the risks associated with economic downturns and changes in consumer behavior.

To reach customers globally throughout the world, it is necessary to have a WooCommerce website that is available in their native language, as a huge percentage of online customers prefer to purchase products that are accompanied by information presented in their language.

This means you have to create a multilingual WooCommerce website, and AI translation may help you get there faster.

Continue reading WooCommerce: How to Implement AI Translation

WooCommerce: Variable Product “Cumulative” Stock Quantity

When a variable product stock quantity is managed at variation level, the stock status is either “In stock” or “Out of stock” without any mention of the quantity.

It would be cool, however, and in certain cases only, to show the total stock quantity for all single variations. If variation Red has 3 in stock, variation Blue has 7 in stock and variation Cyan has 10 in stock, I’d like to set the “parent product” stock quantity to 3 + 7 + 10 = 20.

So, how do we do that?

Continue reading WooCommerce: Variable Product “Cumulative” Stock Quantity

WooCommerce: Getting Started As An Expert – A Complete Guide

If you’re looking to start your own ecommerce store, no platform does it better than WooCommerce.

WooCommerce is your path to online selling success. It’s a flexible, open-source e-commerce plugin specifically built for WordPress websites. 

From setting up and customizing your shop, to mastering orders and sales tracking, this complete guide will walk you through becoming an accomplished WooCommerce expert.

Read on for all the info you need to get the ball rolling!

Continue reading WooCommerce: Getting Started As An Expert – A Complete Guide

WooCommerce: The Ultimate Guide To Printing on Demand

In today’s digital age, ecommerce has witnessed significant growth, offering numerous opportunities for entrepreneurs and businesses to thrive.

One of this space’s most popular and profitable business models is print on demand (POD). Did you know that the POD market is projected to reach a staggering $67.59 billion by 2032?

With its low, upfront costs, ease of implementation, and limitless creative possibilities, POD has become a lucrative venture for many online store owners.

In this ultimate guide, we will explore how to leverage the power of WooCommerce, a leading ecommerce platform, to set up and manage your print on demand store successfully.

Continue reading WooCommerce: The Ultimate Guide To Printing on Demand

WooCommerce: Get Variation IDs By Product Category or Tag

We can get products belonging to a product category or product tag very easily. What’s much more difficult is getting single variations based on a product category or product tag, as variations… don’t have a category or tag, which belong to its “parent” variable product instead.

In this post, we will define a function that you can reuse in your custom code whenever you need to get all variation IDs based on a given product category or product tag. You can then loop through the array and return whatever info you need. Enjoy!

Continue reading WooCommerce: Get Variation IDs By Product Category or Tag

WooCommerce: Hide Specific “Additional Information” Tab Attribute @ Single Product

WooCommerce variable products display the list of attributes and their terms in the “Additional Information” tab on the single product page. For example, it will display “Color: red, yellow” and “Size: large, small” if your variable product uses those attribute terms to generate variations.

Yes, you could completely remove the “Additional Information” tab all together, but sometimes you may need to just hide a specific attribute in this table, for whatever reason. Especially when you want to avoid your customers getting confused and abandoning your website.

So, here’s the fix. Enjoy!

Continue reading WooCommerce: Hide Specific “Additional Information” Tab Attribute @ Single Product

WooCommerce: Search Products By SKU (Frontend)

The frontend WooCommerce product search, for some reason, doesn’t work for SKU values. If it does, then your theme developers were smart enough to include this in their code, because this is a big problem especially for B2B stores.

Today, we’ll study how to alter the product search query, as well as the wc_get_product_id_by_sku() function, which is super helpful to determine the product ID for a given SKU. Enjoy!

Continue reading WooCommerce: Search Products By SKU (Frontend)

WooCommerce: Ajax Add to Cart Quantity @ Shop

As you know, you can tick the “Enable AJAX add to cart buttons on archives” checkbox in the WooCommerce settings in order to add products to cart from the Shop / Category / Tag / loop pages without refreshing the page.

This is great for certain businesses, especially those who sell in bulk and where customers know exactly what they need to buy without the need of checking the single product page.

The bad news is that the Ajax Add to Cart button only allows you to add 1 item to the cart i.e. there is no quantity input field. The other bad news is that the Ajax Add to Cart button only works for simple products, while for variable ones it will turn into a “Select options” link without the possibility of adding a variation to cart from there.

In this tutorial, we will see how to turn the WooCommerce shop into an… Ajax cart with quantity inputs. Enjoy!

Continue reading WooCommerce: Ajax Add to Cart Quantity @ Shop

WooCommerce: Why Variable Products Are Too Limited (and How Add-Ons Can Help)

WooCommerce is rich with customization options for different kinds of eCommerce businesses. However, it’s quite limited when it comes to certain shopping solutions your online business may need – such as displaying product variations.

For instance, a customer may need to choose RAM size, storage size, and device color before buying a mobile phone. In this case, using the default WooCommerce variations will require you to create a variable product with hundreds if not thousands of attribute combinations.

This can be exhausting, and despite all that work, the result is often a slow and difficult to manage product backend due to a huge number of variations . Besides, your customers would have a hard time finding the exact variation when the only option they have are dropdowns with dozens of options.

The best way to give your customers a seamless user experience is to allow them to customize their products on the same page without using variations. Now, you can’t do that with WooCommerce alone. This is where WooCommerce product add-ons plugins come in.

In this article, we’ll show you the easiest way to create and sell variable WooCommerce products using WooCommerce Product Options. But before that, let’s talk about why you need additional product options in your store.

Continue reading WooCommerce: Why Variable Products Are Too Limited (and How Add-Ons Can Help)

WooCommerce: View Stock History @ Product Admin

When questions such as “How do you save the product stock inventory history?” pop up in our private Business Bloomer Club slack channel for WooCommerce developers, I can’t really do without thinking of coding it myself!

This neat customization saves the stock quantity of a simple product or a variable product variation before there is a stock change, due to a manual stock quantity edit or a customer order.

Please bear in mind that if you have hundreds of stock movements per product this may slow down your backend and/or database, so the snippet may need some sort of optimization or limitation (“last 10 movements”).

So, let’s see how it works. Enjoy!

Continue reading WooCommerce: View Stock History @ Product Admin